﻿/*
This file is under Microsoft Public License (MS-PL)
Copyright Yohann MARTEL.  All rights reserved.
Codeplex: http://amf.codeplex.com
AMF Website: http://www.ymartel.com/aspnet-mobile-framework/
*/
using System.ComponentModel;

namespace Mobile.WebControls.Field
{
    internal class RangedControl : InputControl
    {
        #region Properties
        [Category("Functionality")]
        public int? Max { get; set; }
        [Category("Functionality")]
        public int? Min { get; set; }
        #endregion

        #region Constructor
        public RangedControl()
        {
            this.InputType = InputType.Range;
        }
        #endregion

        #region Render Methods
        protected override void AddAttributesToRender(System.Web.UI.HtmlTextWriter writer)
        {
            base.AddAttributesToRender(writer);
            if (Max != null)
            {
                writer.AddAttribute(MobileHtmlTextWriterAttribute.Max, Max.ToString());
            }
            if (Min != null)
            {
                writer.AddAttribute(MobileHtmlTextWriterAttribute.Min, Min.ToString());
            }
        }
        #endregion
    }
}
